<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>盒子模型</title>
  <style>
    /* css reset */
    * {
      margin: 0;
      padding: 0;
    }

    body {
      display: flex;
      flex-direction: column;
      height: 100vh;
    }

    .box {
      /*  
     display可以切换盒子的能力
      box-sizing可以设定盒子的计算方案
      box-sizing 默认值未content-box wxh 指定的是内容的大小 标准盒模型
      border-box wxh 包含了border以内的大小 怪异（IE）盒模型
      */
      box-sizing: content-box;
      width: 200px;
      height: 200px;
      background-color: pink;
      margin: 10px;
      padding: 5px;
      margin-bottom: 10px;
      border: 2px solid rgb(0, 255, 255);
    }

    .flex {
      display: flex;
    }

    main {
      flex: 1;
      position: relative;
    }

    .inner {
      position: absolute;
      top: 0;
      left: 0;
      width: 100px;
      height: 100px;
      background-color: #3bf5ff;
      border-radius: 50%;
      /* 脱离了文档流 */
    }

    .container {
      flex: 1;
      overflow: scroll;
    }

    header,footer {
      height: 44px;
      background-color: #00f69c;
      text-align: center;
    }
    footer{
      display: flex;/* 新的格式化上下文 */
      align-items: center; /* 垂直居中 */
      justify-content: center; /* 水平居中 */
    }
    .more{
      position: absolute;
      width: 50px;
      height: 50px;
      background-color: #a96fff;
      top: 50%;
      left: 50%;
      transform: translate(-50%,-50%);
      margin-left: -50px;/* 往左移动50px */
    }
  </style>
</head>

<body>
  <header>
    <h1>盒模型</h1>
  </header>
  <div class="container">

    <div class="row flex">
      <aside class="box"></aside>

      <main class="box">
        <div class="inner" style="z-index: 999;"></div>
        <div style="position: absolute;width: 100px;height: 100px;background-color: #ff0000;">1+2+3</div>
        <div style="width: 100px;height: 100px;background-color: #ff0000;">1+2+3</div>
      </main>

      <aside class="box"></aside>
    </div>

    <div class="row flex">
      <aside class="box"></aside>

      <main class="box">
        <div class="inner"></div>
        <div style="width: 100px;height: 100px;background-color: #ff0000;">1+2+3</div>
        <div style="width: 100px;height: 100px;background-color: #ff0000;">1+2+3</div>
      </main>

      <aside class="box"></aside>
    </div>

    <div class="row flex">
      <aside class="box"></aside>

      <main class="box">
        <div class="inner"></div>
        <div style="width: 100px;height: 100px;background-color: #ff0000;">1+2+3</div>
        <div style="width: 100px;height: 100px;background-color: #ff0000;">1+2+3</div>
      </main>

      <aside class="box"></aside>
    </div>

    <div class="row flex">
      <aside class="box"></aside>

      <main class="box">
        <div class="inner"></div>
        <div style="width: 100px;height: 100px;background-color: #ff0000;">1+2+3</div>
        <div style="width: 100px;height: 100px;background-color: #ff0000;">1+2+3</div>
      </main>

      <aside class="box"></aside>
    </div>

    <div class="row flex">
      <aside class="box"></aside>

      <main class="box">
        <div class="inner"></div>
        <div style="width: 100px;height: 100px;background-color: #ff0000;">1+2+3</div>
        <div style="width: 100px;height: 100px;background-color: #ff0000;">1+2+3</div>
      </main>

      <aside class="box"></aside>
    </div>

    <div class="row flex">
      <aside class="box"></aside>

      <main class="box">
        <div class="inner"></div>
        <div style="width: 100px;height: 100px;background-color: #ff0000;">1+2+3</div>
        <div style="width: 100px;height: 100px;background-color: #ff0000;">1+2+3</div>
      </main>

      <aside class="box"></aside>
    </div>

  </div>
  <footer>
    <p>盒模型</p>
  </footer>
<div class="more"></div>
</body>

</html>